package com.zj.service.yb;

import java.util.ArrayList;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zj.common.BuilderParam;
import com.zj.common.TiripPackage;
import com.zj.common.mq.SendMessage;
import com.zj.common.mq.SsReciveMessage;
import com.zj.common.xml.XmlUtil;
import com.zj.request.OpenRequest;
import com.zj.request.body.JfmxRqLsReq;
import com.zj.request.body.JhSyYhRqLsReqBody;
import com.zj.request.head.JhSyYhRqLsReqHead;

/*
 * 个人日切流水
 */
@Service
public class JhSyYhRqLs {
	private static final Logger logger = LoggerFactory.getLogger(JhSyYhRqLs.class);
	@Autowired
	SendMessage sendMessage;

	@Autowired
	SsReciveMessage ssReciveMessage;

	public void pk(String crId, TiripPackage tiripPackage) throws Exception {
		// 解析字段存储数据库
		String content = XmlUtil.subCdata(tiripPackage);
		logger.info("接受日切流水响应" + content);
	}

	public void call() throws Exception {
		OpenRequest<JhSyYhRqLsReqHead, JhSyYhRqLsReqBody> request = new OpenRequest<>();
		JhSyYhRqLsReqHead head = new JhSyYhRqLsReqHead("dzrq", "jsyhdm", "blsh", 10, "100", 5, 100, 100, "DFSA");
		JfmxRqLsReq req1 = new JfmxRqLsReq("xtsphm", "swjylsh", "jylx", "100", "20180221");
		JfmxRqLsReq req2 = new JfmxRqLsReq("xtsphm", "swjylsh", "jylx", "100", "20180221");
		List<JfmxRqLsReq> list = new ArrayList<JfmxRqLsReq>();
		list.add(req1);
		list.add(req2);
		JhSyYhRqLsReqBody body = new JhSyYhRqLsReqBody(list);
		request.setBody(body);
		request.setHead(head);
		// 填入测试数据
		String requestBody = BuilderParam.getRqls(request);
		logger.info("日切流水" + requestBody);

	}
}
